﻿@using Website.Models
@model Website.Models.ModelMetadata.Pager

@{
    ViewBag.Title = "Sản Phẩm";
    Layout = "~/Views/Shared/_Template.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.zoom-min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('.products .product img')
        .wrap('<span style="display:block; height: 100%"></span>')
        .css('display', 'block')
        .parent()
        .zoom();
    });
</script>
<div class="productList">
    <div class="products">
        @{
            foreach (Product p in Model.Products)
            {
                <div class="product">
                    <a href="@Url.Action("Details","Home",new{productID = p.ProductID})">
                        <img src="@Url.Content(p.SmallImage)" alt="Image"/>
                    </a>
                    <div>
                        <p class="code">@p.ProductCode</p>
                        <p>@(p.Price.HasValue ? p.Price.Value.ToString("#,##0") : p.PriceLevel.Price.ToString("#,##0")) VND</p>
                        
                    </div>
                </div>
            }
        }
    
    </div>

    @Html.Partial("Pager", Model)
</div>